<?xml version="1.0" encoding="UTF-8"?>
<ui:component xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich">

	<ui:composition template="/pages/templates/layout_principal.xhtml">
		<ui:define name="message">
			<rich:messages globalOnly="true" showSummary="true" showDetail="true">
			</rich:messages>
		</ui:define>

		<ui:define name="body">
			<h:form>
				<h:panelGrid styleClass="titulo">
					<h:outputText styleClass="titulo" value="#{menuControl.nomeProjetoSelecionado} - Novo Caso Uso"  />
				</h:panelGrid>
				
				<br />
				<rich:panel header="Dados caso uso" style="width:560px">
					<h:panelGrid columns="2">
						<h:outputText value="*Caso Uso:" styleClass="form_label" />
						<h:panelGroup>
							<h:inputText value="#{manterCasosUsoControl.casoUso.nomeCasoUso}" id="nome" required="true" maxlength="40" size="50" />
							<rich:message for="nome" />
						</h:panelGroup>
							
						<h:outputText value="Breve descrição:" styleClass="form_label" />
						<h:panelGroup>
							<h:inputTextarea value="#{manterCasosUsoControl.casoUso.breveDescricao}" id="descricao" cols="57" rows="4" >
								<f:validateLength maximum="200" />
							</h:inputTextarea>
							<rich:message for="descricao" />
						</h:panelGroup>
					</h:panelGrid>
				</rich:panel>	    

       			 <br />
										
		
							
			     <rich:panel style="width:560px;">
            	 	<f:facet name="header">
               			<h:outputText value="Atrelar requisito ao caso de uso"></h:outputText>
            		</f:facet>
           			 <rich:pickList value="#{manterCasosUsoControl.requisitosSelecionados}" sourceCaption="Requisitos disponíveis" targetCaption="Requisitos relacionados ao caso de uso" listWidth="165px" listHeight="100px" orderable="true">
               			 <f:selectItems value="#{manterCasosUsoControl.listRequisito}" var="requisito" itemValue="#{requisito.id}" itemLabel="#{requisito.nome}" />
               		
            		</rich:pickList>
 
       		      </rich:panel>
				
								
				<br />
				
				<h:panelGrid columns="3" cellpadding="3" styleClass="botoes">
					<h:commandButton action="#{manterCasosUsoControl.incluirCasoUso}" value="Incluir" rendered="#{manterCasosUsoControl.exibirIncluir}" />
					<h:commandButton action="#{manterCasosUsoControl.alterarCasoUso}" value="Alterar" rendered="#{manterCasosUsoControl.exibirAlterar}" />
					<h:commandButton action="#{manterCasosUsoControl.listarCasoUso}" value="Voltar" immediate="true" />
				</h:panelGrid>
			</h:form>
		</ui:define>
	</ui:composition>

</ui:component>